package com.by.dao;

import com.by.pojo.Person;
import org.springframework.stereotype.Repository;

/**
 * @Description: 数据访问层，访问数据库
 * @Param: * @param null
 * @return:
 * @Author: GP
 * @Date: 2024/1/17
 */
@Repository //作用：new PersonServiceImpl(),并装到容器里
public class PersonDaoImpl implements PersonDao {

    @Override
    public Person getPersonById(Integer id) {
        System.out.println("select * from user where id = " + id);
        return new Person(id, "小简老婆", 18, "老婆大人", "漂亮美丽，活泼可爱，温柔大方，贤惠贴心");
    }

    @Override
    public void delPersonById(Integer id) {
        System.out.println("delete from user where id = " + id);
    }

    @Override
    public void addPerson() {
        System.out.println("insert into user(id,name,age,role,trait) values(......)");
    }

}
